package cn.xu.liteflow;

import com.yomahub.liteflow.parser.el.ClassJsonFlowELParser;

/**
 * @Author xuguofei clark2021@qq.com || WX clark_2023
 * @Date 2024/3/13
 * @Desc TODO
 **/
public class TestCustomerParserFlowJsonFileConfig extends ClassJsonFlowELParser {
    @Override
    public String parseCustom() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("{\n" +
                "  \"flow\": {\n" +
                "    \"nodes\": {\n" +
                "      \"node\": [\n" +
                "        {\n" +
                "          \"id\": \"s1\",\n" +
                "          \"name\":\"普通脚本1\",\n" +
                "          \"type\":\"script\",\n" +
                "          \"language\":\"java\",\n" +
                "          \"value\": \"import cn.xu.liteflow.script.CommonT;\\n\\n                    import cn.xu.liteflow.components.Order;\\n                    import com.yomahub.liteflow.script.ScriptExecuteWrap;\\n                    import com.yomahub.liteflow.script.body.JaninoCommonScriptBody;\\n\\n                    import java.io.Serializable;\\n                    import java.util.HashMap;\\n                    import java.util.List;\\n                    import java.util.Map;\\n                    import java.util.concurrent.Callable;\\n\\n                    public class S1 implements JaninoCommonScriptBody {\\n                        @Override\\n                        public Void body(final ScriptExecuteWrap wrap) {\\n                            return CommonT.test(wrap, new Callable<Void>() {\\n                                @Override\\n                                public Void call() throws Exception {\\n                                    Order order = (Order)wrap.cmp.getContextBean(Order.class);\\n                                    System.out.println(order);\\n                                    Map<String, List<Serializable>> requestContextDataMap = (HashMap<String, List<Serializable>>)order.getRequestContextDataMap();\\n                                    List<Serializable> aaa = (List<Serializable>)requestContextDataMap.get(\\\"aaa\\\");\\n                                    System.out.println(aaa);\\n                                    return null;\\n                                }\\n                            });\\n                        }\\n                    }\"\n" +
                "        }\n" +
                "      ]\n" +
                "    },\n" +
                "    \"chain\": [\n" +
                "      {\n" +
                "        \"name\": \"chain12\",\n" +
                "        \"value\": \"THEN(aContext, s1, bContext, c);\"\n" +
                "      }\n" +
                "    ]\n" +
                "  }\n" +
                "}\n");
        return stringBuilder.toString();
    }
}
